<?php
/* @var $this IncomeController */
/* @var $model Income */

?>
<div class="row-fluid">
    <div class="span12">
        <ul class="quick-actions-horizontal pull-right">
            <li>
                <a href="<?php echo Yii::app()->createAbsoluteUrl('income/create'); ?>">
                    <i class="icon-plus"></i>
                    <span>Thêm khoản thu mới</span>
                </a>
            </li>
        </ul>
    </div>
</div>
<div class="row-fluid">
    <div class="span12">
        <div class="widget-box">
            <?php $this->widget('bootstrap.widgets.TbGridView', array(
                'id' => 'income-grid',
                'dataProvider' => $model->search(),
                'filter' => $model,
                'columns' => array(
                    array(
                        'name' => 'id',
                        'value' => '$data->id',
                    ),
                    array(
                        'name' => 'name',
                        'value' => '$data->name',
                    ),
                    array(
                        'name' => 'cat_id',
                        'value' => array($this, 'getCatName')
                    ),
                    array(
                        'name' => 'note',
                        'value' => '$data->note',
                    ),
                    array(
                        'name' => 'time',
                        'value' => 'date("d/m/Y", $data->time)',
                    ),
                    array(
                        'name' => 'reference',
                        'value' => '$data->reference',
                    ),
                    array(
                        'name' => 'value',
                        'value' => '$data->value',
                    ),
                    array(
                        'header' => 'Action',
                        'class' => 'CButtonColumn',
                        'htmlOptions' => array('style'=>'width:80px'),
//                            'template' => '{delete}{update}',
                    ),
                ),
            )); ?>
        </div>
    </div>
</div>